package com.iretailer.report.dto;

import com.iretailer.report.util.TimeUtil;

import java.text.MessageFormat;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;

/**
 * @Auther: xjw
 * @Date: 2019/3/15 16:56
 * @Description:
 */
public class PassByModel {
    private String camerazoneid;

    private String physicalZoneId;

    private String physicalZoneName;

    private String mallId;

    private String tagTypeId;

    private String mallName;

    private String cityId;

    private int countPass;

    private int countEnter;

    private String dateTime;

    private ZonedDateTime zonedDateTime;

    public String getAll_dateTime_Group() {
        if (this.dateTime != null) {
            return MessageFormat.format("All_{0}", this.dateTime);
        } else {
            return null;
        }
    }

    public String getTagType_dateTime_Group() {
        if (this.dateTime != null) {
            return String.format("%s_%s", this.tagTypeId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getMall_dateTime_Group() {
        if (this.dateTime != null) {
            return MessageFormat.format("{0}_{1}", this.mallId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getZone_dateTime_Group() {
        if (dateTime != null) {
            return MessageFormat.format("{0}_{1}", this.physicalZoneId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getWeek_dateTime_Group() {
        if (this.dateTime != null && this.dateTime != null) {
            return MessageFormat.format("{0}_{1}", TimeUtil.getWeekOfLocalDate(TimeUtil.parse_LocalDateTime(dateTime).toLocalDate()));
        } else {
            return null;
        }
    }

    public String getMallGroup() {
        if (this.mallId != null && this.dateTime != null) {

            return MessageFormat.format("{0}_{1}", this.mallId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getPhysicalGroup() {
        if (this.physicalZoneId != null && this.dateTime != null) {
            return MessageFormat.format("{0}_{1}", this.physicalZoneId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getWeekGroup() {
        if (this.dateTime != null) {
            LocalDateTime ldt = TimeUtil.parse_LocalDateTime(this.dateTime);
            return MessageFormat.format("{0}__2016-01-01 {1}", TimeUtil.getWeekOfLocalDate(ldt.toLocalDate()),
                    TimeUtil.localDateTime_format(ldt, "HH:mm:ss"));
        } else {
            return null;
        }
    }

    public String getTagTypeId() {
        return tagTypeId;
    }

    public void setTagTypeId(String tagTypeId) {
        this.tagTypeId = tagTypeId;
    }

    public String getCamerazoneid() {
        return camerazoneid;
    }

    public void setCamerazoneid(String camerazoneid) {
        this.camerazoneid = camerazoneid;
    }

    public String getPhysicalZoneId() {
        return physicalZoneId;
    }

    public void setPhysicalZoneId(String physicalZoneId) {
        this.physicalZoneId = physicalZoneId;
    }

    public String getPhysicalZoneName() {
        return physicalZoneName;
    }

    public void setPhysicalZoneName(String physicalZoneName) {
        this.physicalZoneName = physicalZoneName;
    }

    public String getMallId() {
        return mallId;
    }

    public void setMallId(String mallId) {
        this.mallId = mallId;
    }

    public String getMallName() {
        return mallName;
    }

    public void setMallName(String mallName) {
        this.mallName = mallName;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public int getCountPass() {
        return countPass;
    }

    public void setCountPass(int countPass) {
        this.countPass = countPass;
    }

    public int getCountEnter() {
        return countEnter;
    }

    public void setCountEnter(int countEnter) {
        this.countEnter = countEnter;
    }

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public ZonedDateTime getZonedDateTime() {
        return zonedDateTime;
    }

    public void setZonedDateTime(ZonedDateTime zonedDateTime) {
        this.zonedDateTime = zonedDateTime;
    }
}
